<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
      
<h:head>
  <title><ui:insert name="title">PKLIB</ui:insert></title>
  <link rel="stylesheet" type="text/css" href="theme.css" />
  <script src="focus.js" type="text/javascript"></script>
</h:head>

<body>

<div id="header" >

    <div id="page">
		<div id="main">
			<div id = "banner">

				<a href="index.xhtml"> </a>


			</div>
			<div id="login">


				<h:form id="login" rendered="#{!userBean.logged}">
					<h:outputLabel>Login</h:outputLabel>
					<h:inputText id="login" value="#{userBean.login}" required="true" />

					<h:outputLabel>Hasło</h:outputLabel>
					<h:inputSecret id="author" value="#{userBean.password}"
						required="true" />

					<h:outputText value="#{userBean.result}" />

					<h:commandButton value="Zaloguj" action="#{userBean.logIn}" />
					<a href="register.xhtml">Zarejestruj się</a>
				</h:form>

				<h:form id="loggOut" rendered="#{userBean.logged}">
					<h:outputText value="#{userBean.result}" />
					<h:commandButton value="Wyloguj" action="#{userBean.logOut}" />
				</h:form>

				<h:messages globalOnly="true" layout="table"></h:messages>
				<h:message for="login"></h:message>



			</div>



			<div id="menu1">
				<div>
					<h:panelGroup id="panelLogged" rendered="#{userBean.logged}">
						<br />
						
						<a href="myBooks.xhtml"><img src="images/mk.png"/></a>
						<br />
						<a href="myLoans.xhtml"><img src="images/mw.png"/></a>
						<br />
						<a href="addBook.xhtml"><img src="images/dk.png"/></a>
						<br />
						<a href="menu.xhtml"><img src="images/re.png"/></a>
					</h:panelGroup>
				</div>
				<div>
					<h:panelGroup id="panelNotLogged">
						<br />
						<a href="about.xhtml"><img src="images/ab.png"/></a>
						
					</h:panelGroup>
				</div>

			</div>
			<div id="content">
				<ui:insert name="content">

				</ui:insert>
			</div>

			<div id="menu2">
			<br />
			<h:panelGroup id="panelLogged2" rendered="#{userBean.logged}">
			<img src="images/pk.png"/>
			</h:panelGroup>
			<br />
			<ui:repeat value="#{userBean.suggestions}" var="book">
				<br />
 				<h:outputText value="#{book.author}" style="font-size:14px"/>
 				<h:outputText value=" - " style="font-size:14px"/>
 				<h:outputText value="#{book.title}" style="font-size:14px"/>
 				<br />
			</ui:repeat>	
			
			</div>
			<div style="clear: both; width: 100%"></div>
		</div>
	</div>

</div>
 

</body>

</html>
